import { TemplateTestDto } from '@/views/template-manage/testOnline/index';
import { GenGroup } from '@/views/template-manage/group/index';
import { request } from '@/service/request';

export function featchTemplateGroupPage(searchData:Common.SearchData<GenGroup>){
	return request.post<GenGroup[]>("/gen/group/list",searchData)
}

export function featchTemplateGroup(id:Common.IdType){
	return request.get<GenGroup>(`/gen/group/${id}`)
}

export function featchAddTemplateGroup(data:GenGroup){
	return request.post<GenGroup>('/gen/group/',data)
}

export function featchCopyTemplateGroup(id:Common.IdType){
	return request.post<GenGroup>(`/gen/group/copy/${id}`,{})
}

export function featchUpdateTemplateGroup(data:GenGroup){
	return request.put<GenGroup>('/gen/group/',data)
}
export function featchRemoveTemplateGroup(id:Common.IdType){
	return request.delete(`/gen/group/${id}`,{})
}


export function featchTemplateDfVar(){
	return request.get<Record<string,any>>("/gen/group/dfVar")
}

export function featchGroupOptions(){
	return request.get<GenGroup[]>("/gen/group/list/option")
}

export function featchTemplateTestOnline(dto:TemplateTestDto){
	return request.post<string>("/template/testOnline",dto)
}
